<!DOCTYPE html>
<html>

<head>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">


	<title> - 登录</title>
	<meta name="keywords" content="">
	<meta name="description" content="">

	<link rel="shortcut icon" href="/Public/favicon.ico"> <link href="/Public/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	<!--<link href="/Public/css/font-awesome.css?v=4.4.0" rel="stylesheet">-->

<!--	<link href="/Public/css/animate.css" rel="stylesheet">-->
	<link href="/Public/css/style.css?v=4.1.0" rel="stylesheet">
	<!--[if lt IE 9]>
	<meta http-equiv="refresh" content="0;ie.html" />
	<![endif]-->
	<script>if(window.top !== window.self){ window.top.location = window.location;}</script>

</head>

<body class="gray-bg">

<div class="middle-box text-center loginscreen  animated fadeInDown">
	<div>
		<div>

			<h2 style=" font-weight: 800;font-size: 30px;margin-top: 250px;">共享现金客服系统</h2>

		</div>

		<form class="m-t" role="form" action="index.html">
			<div class="form-group">
				<input type="text" id="phone" class="form-control" placeholder="用户名" required="">
			</div>
			<div class="form-group">
				<input type="password"  id="pwd"  class="form-control" placeholder="密码" required="">
			</div>
			<button type="button" id="login_btn" class="btn btn-primary block full-width m-b">登 录</button>


			<!-- <p class="text-muted text-center"> <a href="login.html#"><small>忘记密码了？</small></a>
			</p> -->

		</form>
	</div>
</div>

<!-- 全局js -->
<script src="/Public/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/Public/js/plugins/layer/layer.min.js"></script>
<script>
	var home="<{$SRVER_NAME}>/admin.php/Index/index";
	$('#login_btn').on('click', function(){
		//加载loading层
		var index = layer.load(1, {
			shade: [0.1,'#fff'] //0.1透明度的白色背景
		});
		var phone=$('#phone').val();
		var pwd=$('#pwd').val()
		if(phone==''){
            layer.alert("账号不能为空！\r\n",{
                title: '提示框',
                icon:0,
            });
            layer.close(index);
            return false;
		}
        if(pwd==''){
            layer.close(index);
            layer.alert("密码不能为空！\r\n",{
                title: '提示框',
                icon:0,
            });
            return false;
        }

			$.post('<{$SRVER_NAME}>/admin.php/Login/get_login',{phone:phone,pwd:pwd}, function(data){
                console.log('ddddd',data);
						if(data.code=='1001'){
							layer.alert('登陆成功！',{
								title: '提示框',
								icon:1,
							});
							location.href=home;
							layer.close(index);
						}else{
							layer.alert(data.result,{
								title: '提示框',
								icon:1,
							});
							layer.close(index);
						}
					},'json');
	});

    document.onkeydown=function(event){
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if(e && e.keyCode==27){ // 按 Esc
            //要做的事情
        }
        if(e && e.keyCode==113){ // 按 F2
            //要做的事情
        }
        if(e && e.keyCode==13){ // enter 键
            $('#login_btn').click();
            //要做的事情
        }
    };
</script>


</body>

</html>
